package algorithm.tree;

/**
 * 树的节点定义
 *
 * @author: fengpeng
 * @date: 2018/12/12  上午11:54
 */
public class BinaryNode<T extends Comparable<? super T>> {

    /**
     * 节点数据
     */
    T data;

    /**
     * 左子树
     */
   BinaryNode<T> left;

    /**
     * 右子树
     */
   BinaryNode<T> right;

   public BinaryNode(T data) {
        this(data,null,null);
    }


    public BinaryNode( T data, BinaryNode<T> left, BinaryNode<T> right) {
        this.data =data;
        this.left = left;
        this.right =right;
    }


    public BinaryNode()
    {
        data =null;
        this.left = null;
        this.right = null;
    }
}
